/**
 * This class represents a logging-system
 * 
 * @author Konrad Paumann
 * @author Bernhard Denner
 * @author Maximilian Csuk
 * 
 * $Revision$ 
 * $Date$
 * 
 */

import java.util.*;

public class Logger implements Displayable {
	/**
	 * variable
	 */
	private LinkedList<String> lines;
	
	/**
	 * constructor
	 */
	public Logger() {
		lines = new LinkedList<String>();
	}
	
	/**
	 * ads a log to the log list
	 * @param username
	 * @param line
	 */
	public void log(String username, String line) {
		lines.add(username + ": " + line);
	}
	
	public String getDisplayString() {
		String tmp = new String("");
		Iterator<String> it = lines.iterator();
		while(it.hasNext())
			tmp += it.next() + "\n";
		return tmp;
	}
}
